@mixin clearfix {
  &:after {
    content: '';
    display: table;
    clear: both;
  }
}

@mixin parameterCard {
  $errorColor: #f56c6c;
  ::v-deep .el-dialog__body {
    padding: 0;
  }

  .parameter-card {
    background-color: #ffffff;
    width: 100%;
    height: 100%;
    position: relative;
    display: inline-block;
    border-radius: 4px;
    padding: 5px;

    &::v-deep .el-form-item {
      margin-bottom: 0;
    }

    .el-checkbox {
      display: flex;
    }

    &.border {
      border: 1px dashed #dcdfe6;
    }

    &.flex {
      display: flex;
      flex-direction: column;
      justify-content: center;
      align-items: flex-start;
    }

    &.new-param {
      background-color: #091e420a;
      cursor: pointer;

      &:hover {
        background-color: #091e4214;
      }
    }

    &--active {
      border-color: $activeColor !important;
      /* border-width: 2px; */
    }

    &--error {
      border-color: $errorColor !important;
    }

    &.line {      
      flex-direction: column;
      display: flex;
      justify-content: center;
    }

    .parameter-card__close {
      position: absolute;
      right: 0;
      top: 0;
      cursor: pointer;
      @apply transition-colors;
    }

    .parameter-card__title {
      font-weight: bold;      
      width: 100%;
      

      &--reference {
        text-overflow: ellipsis;
        white-space: nowrap;
        overflow: hidden;
      }
    }
    

    .parameter-card__number,
    .parameter-card__title {
      font-size: 14px;
    }

    .parameter-card__number,
    .parameter-card__content,
    .parameter-card__close {
      color: #c0c4cc;
    }

    .parameter-card__number {
      float: right;
      margin-right: 5px;
    }

    .el-select {
      height: 28px;
      width: 100%;
      // display: block;
    }

    .vue-grid-item > .vue-resizable-handle {
      padding: 0;
    }

    .parameter-reference button {
      display: flex;
      align-items: center;
      width: 100%;
    }
  }
}

@mixin preview {
  .preview-container {
    padding: 10px;
    background-color: #1e1e1e;
    min-height: calc(100vh - 33px);
  }
}

@mixin scrollBar {
  &::-webkit-scrollbar-track-piece {
    background: #d3dce6;
  }

  &::-webkit-scrollbar {
    width: 6px;
  }

  &::-webkit-scrollbar-thumb {
    background: #99a9bf;
    border-radius: 20px;
  }
}

@mixin relative {
  position: relative;
  width: 100%;
  height: 100%;
}

@mixin banner {
  height: 100px;
  background-size: cover;
  background-position: center;
}

@mixin center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

@mixin elIconButton {
  .el-icon-button {
    width: 32px;
    height: 32px;
    vertical-align: middle;
    padding: 0;
    font-size: 18px;
  }
}

@mixin action-bar {
  .action-bar {
    height: 33px;
    background: #f2fafb;
    padding: 0 15px;
    display: flex;
    align-items: center;
    justify-content: flex-end;    
    box-sizing: border-box;    

    .bar-btn {
      display: inline-block;
      padding: 0 6px;
      line-height: 32px;
      color: #8285f5;
      cursor: pointer;
      font-size: 14px;
      user-select: none;

      & i {
        font-size: 20px;
        vertical-align: middle;
      }

      &:hover {
        color: #4348d4;
      }
    }

    .bar-btn + .bar-btn {
      margin-left: 8px;
    }

    .delete-btn {
      color: #f56c6c;

      &:hover {
        color: #ea0b30;
      }
    }
  }
}

@mixin formIcon {
  .entry-list-icon,
  .form-icon {
    width: 18px;
    height: 18px;
  }
}

@mixin selectTemplate {
  $activeColor: #409eff;

  .select-template-dialog {
    .sidebar {
      border-right: 1px solid #e5effb;

      .title {
        border-bottom: 1px solid #e5effb;
      }

      .menu-item {
        cursor: pointer;
        height: 50px;
        line-height: 50px;
        text-align: center;
        border-bottom: 1px solid #e5effb;
        border-left: 4px solid transparent;

        &.active {
          border-left-color: $activeColor;
          color: $activeColor;
        }
      }
    }

    .select-template {
      border-right: 1px solid #e5effb;

      .title {
        padding: 10px 0;
        color: #767676;
      }

      .templates-container {
        padding: 0 10px 20px;
        min-height: 300px;
        border-bottom: 1px solid #e5effb;
      }

      .template-box {
        cursor: pointer;
        margin-right: 10px;
        border: 2px solid #dcdfe6;
        border-radius: 4px;
        display: inline-block;
        position: relative;
        width: 240px;
        height: 130px;

        //padding: 65px 120px;
        &.new {
          border-style: dashed;

          &:hover {
            color: $activeColor;
          }

          .item-new {
            position: absolute;
            top: 50%;
            left: 50%;
            font-size: 36px;
            transform: translate(-50%, -50%);
          }
        }

        &:hover {
          border-color: $activeColor;

          & + p {
            color: $activeColor;
          }
        }

        &.selected {
          border-color: $activeColor;
          border-width: 2px;

          & + p {
            color: $activeColor;
          }
        }

        .template-actions {
          width: 100%;
          text-align: right;
          bottom: 10px;
          position: absolute;
          padding-right: 15px;

          span {
            i {
              transition: all 0.3s;
            }

            &:hover {
              color: $activeColor;

              i {
                transform: scale(1.2);
              }
            }
          }
        }

        /*.template-actions {
          position: absolute;
          display: flex;
          justify-content: center;
          align-items: center;
          width: 100%;
          height: 100%;
          left: 0;
          top: 0;
          text-align: center;
          color: #fff;
          opacity: 0;
          font-size: 20px;
          background-color: rgba(0, 0, 0, 0.5);
          transition: opacity 0.3s;
          &:hover {
            opacity: 1;
          }
          .item-delete,
          .item-edit,
          .item-new {
            &:hover {
              color: $activeColor;
            }
          }
        }*/
      }

      .import-template {
        padding: 0 10px 50px;
      }
    }

    .introduction {
      padding: 10px;
    }
  }
}

@mixin listCard {
  .list-wrapper {
    min-height: 130px;
    box-shadow: 0 2px 5px 1px rgba(202, 202, 202, 0.16);
    display: inline-block;
    /* height: 300px; */
    // margin: 0 4px;
    vertical-align: top;
    background-color: #ebecf0;
    // width: 300px;
    width: 100%;
    .list {
      border-radius: 3px;
      box-sizing: border-box;
      display: flex;
      flex-direction: column;
      max-height: 100%;
      position: relative;
      white-space: normal;
      width: 100% !important;
    }
  }

  .list-header {
    flex: 0 0 auto;
    min-height: 20px;
    padding: 10px 8px;
    padding-right: 36px;
  }

  .list-header-name {
    overflow: hidden;
    overflow-wrap: break-word;
    height: 28px;
    font-weight: 600;
    padding: 4px 8px;
    text-align: left;
  }

  .list-cards {
    flex: 1 1 auto;
    margin: 0 4px;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 0 4px;
    z-index: 1;
  }

  .list-card {
    font-size: 14px;
    background-color: #fff;
    border-radius: 3px;
    box-shadow: 0 1px 0 #091e4240;
    cursor: pointer;
    display: block;
    margin-bottom: 8px;
    /* max-width: 300px; */
    min-height: 20px;
    position: relative;
    text-decoration: none;
    z-index: 0;
    &:hover {
      background-color: #f4f5f7;
      border-bottom-color: #091e4240;
      .list-card-operation {
        visibility: visible;
        &:hover {
          background-color: #ebecf0;
          opacity: 1;
          color: #172b4d;
          text-decoration: none;
        }
      }
    }
  }

  .list-card-details {
    overflow: hidden;
    padding: 6px 8px 2px;
    position: relative;
    z-index: 10;
  }

  .list-card-title {
    word-wrap: break-word;
    clear: both;
    color: #172b4d;
    display: block;
    margin: 0 0 4px;
    overflow: hidden;
    text-decoration: none;
  }

  .open-card-composer {
    border-radius: 3px;
    color: #5e6c84;
    display: block;
    /* flex: 1 0 auto; */
    margin: 2px 8px 0px 8px;
    padding: 4px 8px;
    position: relative;
    text-decoration: none;
    -webkit-user-select: none;
    user-select: none;
    &:hover {
      background-color: #091e4214;
      color: #172b4d;
    }
  }

  .icon-add {
    color: #6b778c;
    margin-right: 2px;
    font-size: 16px;
    height: 20px;
    line-height: 20px;
    width: 20px;
  }
  .card-composer {
    padding: 8px 0;
  }
  .card-composer-container {
    /* display: flex; */
    justify-content: space-between;

    min-height: 38px;
  }

  .controls {
    display: flex;
    align-items: center;
    padding-top: 4px;
    .submit-button {
      background-color: #0079bf;
      border: none;
      box-shadow: none;
      color: #ffffff;
      align-items: center;
      border: none;
      border-radius: 3px;
      box-shadow: none;
      box-sizing: border-box;
      margin: 0px 4px 0 0;
      cursor: pointer;
      display: inline-flex;
      font-family: -apple-system;
      font-size: 14px;
      font-weight: 400;
      justify-content: center;
      line-height: 20px;
      padding: 6px 12px;
      text-decoration: none;
      transition-duration: 85ms;
      transition-property: background-color, border-color, box-shadow;
      transition-timing-function: ease;
      white-space: normal;
      text-align: center;
      &:hover {
        background-color: #026aa7;
        border: none;
        box-shadow: none;
        color: #fff;
      }
    }
    .cancel-button {
      display: inline-block;
      color: #6b778c;
      height: 32px;
      line-height: 32px;
      width: 32px;
      font-size: 24px;
      &:hover {
        color: #172b4d;
        text-decoration: none;
      }
    }
  }

  .controls-section {
    display: flex;
    align-items: center;
  }
}

@mixin inputAppendButton {
  .input-append-container {
    &::v-deep .el-input__inner {
      border-top-right-radius: 0;
      border-bottom-right-radius: 0;
    }
  }
  .input-append {
    background-color: #f5f7fa;
    color: #909399;
    vertical-align: middle;
    display: table-cell;
    position: relative;
    border: 1px solid #dcdfe6;
    border-radius: 4px;
    padding: 0 14px;
    // width: 1px;
    white-space: nowrap;
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    line-height: 30px;

    .el-button {
      border-color: transparent;
      background-color: transparent;
      color: inherit;
      border-top: 0;
      border-bottom: 0;
      display: inline-block;
      margin: -10px -20px;
    }
  }
}

@mixin hintButton {
  .hint-button {
    background: transparent;
    border-radius: 3px;
    margin: 0;
    padding: 0;
    border: 2px solid transparent;
  }

  .hint-svg {
    display: inline-block;
    line-height: 1;
  }
}

@mixin elSelectAppend {
  .el-select-append {
    background-color: #f5f7fa;
    color: #909399;
    vertical-align: middle;
    display: table-cell;
    position: relative;
    border: 1px solid #dcdfe6;
    border-radius: 4px;
    padding: 0 20px;
    // width: 1px;
    white-space: nowrap;
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    line-height: 30px;

    .el-button {
      border-color: transparent;
      background-color: transparent;
      color: inherit;
      border-top: 0;
      border-bottom: 0;
      display: inline-block;
      margin: -10px -20px;
    }
  }

  .el-select__reference {
    flex: 1 1;

    ::v-deep input {
      border-top-right-radius: 0;
      border-bottom-right-radius: 0;
    }
  }
}
